package com.headfirst.decorator.version1;

/**
 * 综合咖啡,是一种具体的饮料,继承了抽象的饮料类Beverage
 * @author sunhongguang
 * @create 2022-01-22-20:50
 */
public class HouseBlend extends Beverage {

    public HouseBlend() {
        super.setDescription(super.getSize()+" House Blend");
    }

    public HouseBlend(String size){
        super.setSize(size);
        super.setDescription(size+" House Blend");
    }

    @Override
    public double cost() {
        double price = 0;
        switch (super.getSize()){
            case "小杯":
                price = 0.89;
                break;
            case "中杯":
                price = 1.09;
                break;
            case "大杯":
                price = 1.27;
                break;
            case "超大杯":
                price = 1.41;
                break;
        }
        return price;
    }
}
